<template>
  <div>{{ double }} --{{ count }}</div>
  <el-button @click="handleClick">click</el-button>
</template>

<script>
import { computed } from "vue";
import { useStore } from "vuex";
export default {
  name: "App",
  components: {},
  setup() {
    // stroe
    // this.$store
    const store = useStore();
    console.log(store);
    const double = computed(() => store.state.count * 2);
    const count = computed(() => store.state.count);

    const handleClick = () => {
      store.commit("count");
    };
    return {
      double,
      count,
      handleClick
    };
  }
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
